/**
 * 
 */
package org.swing.utility.common.datetime;

import org.joda.time.DateTime;
import org.swing.utility.common.imp.DateTimeDuration;

/**
 * @author lqnhu
 *
 */
public class DateTimeMonth extends DateTimePeriod {
	protected DateTimeMonth(DateTime start, DateTime end) {
		super(start, end, DateTimeDuration.MONTH, "yyyy-MM", "MMMM yyyy",
				"yyyy-MM", "MM");
	}

	@Override
	public DateTimePeriod getNext() {
		DateTime next = getStart().plusMonths(1);
		return DateTimePeriod.createMonth(next);
	}

	@Override
	public DateTimePeriod getPrevious() {
		DateTime previous = getStart().minusMonths(1);
		return DateTimePeriod.createMonth(previous);
	}

	@Override
	public DateTimeDuration getDefaultSubDuration() {
		return DateTimeDuration.DAY;
	}
}
